The signature of an operation consists of its name and all its parameters (including the return parameter, which defines the return type of the operation). You can view and edit the signature in the General tab of the Properties view when an operation is selected. The operation signature is also visible and sometimes editable in other places in the Rational Software Architect RealTime Edition (RSARTE) user interface. Some examples are:

RSARTE supports a subset of the textual syntax for operation signatures that is standardized in the UML specification (UML Superstructure Specification v. 2.3, chapter 7.3.36 Operation):

[<visibility>] <name> '(' [<parameter-list>] ')' [':' [<return-type>] ['[' <multiplicity> ']']

Items within square brackets are optional.The different parts of this signature syntax are:

<visibility> The visibility of the operation. The usual UML visibility syntax is used, for example,  '+' (public), '-' (private), '#' (protected), and '~' (package). The syntax for package visibility is the same as when defining a destructor operation. RSARTE prints the stereotype angle brackets («») when you start to edit the signature. If the '~' character is placed before the angle brackets, it is interpreted as a specification of package visibility. If the '~' character is placed after the angle brackets, it is interpreted as belonging to the operation name (which is the case when defining a destructor). Some examples:

~«» op ()            

Definition of an operation 'op' with package visibility (indicated by a small package decorator in the Project Explorer):     

«» ~C ()             

Definition of an operation with the name ~C, for example. It is a destructor in the context of C++ code generation

The visibility part of the signature syntax only applies when editing a signature. It is not shown otherwise. A decorator on the operation icon shows the visibility of the operation.

<name>The name of the operation. The name must be valid in the target language that is used.

<parameter list> All the parameters of the operation, usually excluding the return parameter, which is specified using the <return-type> instead. The parameters are comma-separated and adhere to the following syntax:

 '['<direction>']' <parameter-name> ':' <type-expression> ['['<multiplicity>']'] ['=' <default>]

<direction> The direction of the parameter. Contrary to the UML standard, RSARTE always shows the direction and encloses it in square brackets. The default direction is [in], and other valid directions are [inout] and [out]. You can also use [return] to specify a return parameter, but the more common way to do this is to specify a return type for the operation. Read more about parameter directions in RSARTE Concepts (here), chapter "Operation".

<parameter-name>The name of the parameter. The name must be valid in the target language that is used.

<type expression> The type of the parameter. You can use any valid type defined either in the model or in the target code environment.

<multiplicity> The multiplicity of the parameter. It is written within square brackets immediately after the type.

<default> The default value of the parameter.

Here are some examples of operations with different kinds of parameters:

«» op ( [in] y : int = 4 )      

Operation with one [in] parameter 'y' of type 'int' and with default value 4.

«» op ( [inout] z : bool, [in] s : CPPModel::Class1 ))

Operation with one [inout] parameter 'z' of type 'bool' and one [in] parameter 's' typed by a class "Class1" in the model package "CPPModel".

A return type for the operation can be specified after a colon at the end of the signature. You can also specify a multiplicity for the return parameter using square brackets. An example:

«» op ( [in] s : char* )) : int[10]

Operation with one [in] parameter 's' of type 'char*' and with a return parameter of type 'int' and multiplicity 10.

Not all parts of the signature syntax are supported when modifying an existing operation. If you find that a modification of the signature for an existing operation does not produce the desired result, you can edit the operation and its parameters using the other fields in the Properties view.